
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'coffee-shop-image-form',
	'enableAjaxValidation'=>false,
'htmlOptions'=>array('enctype'=>'multipart/form-data')
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
<!-- 
	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>
	 -->
	<div class="row">
		Upload File:
		<?php echo $form->fileField($model,'imageUpload'); ?>
		<?php echo $form->error($model,'imageUpload'); ?>
	</div>
	<div class="row">
		Upload Thumb: (Files will not be resized if thumb is uploaded)
		<?php echo $form->fileField($model,'thumbUpload'); ?>
		<?php echo $form->error($model,'thumbUpload'); ?>
	</div>
	<?php if(Yii::app()->user->checkAccess('admin')){?>
<div class="row">
		<?php echo $form->labelEx($model,'categoryId'); ?>
		<?php echo $form->dropDownList($model,'categoryId',
		CoffeeShopImage::$categories
		); ?>
		<?php echo $form->error($model,'categoryId'); ?>
		<p class="hint">The larger number means this image has higher priority. The largest will be the main image.</p>
	</div>
<?php } ?>
	<div class="row">
		<?php echo $form->labelEx($model,'priority'); ?>
		<?php echo $form->textField($model,'priority'); ?>
		<?php echo $form->error($model,'priority'); ?>
		<p class="hint">The larger number means this image has higher priority. The largest will be the main image.</p>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->